package com.yuyou.fn.api;

import com.yuyou.fn.api.dto.*;

import java.util.Collection;
import java.util.List;

public interface CourseClassTradingService {


    /**
     * 添加课程到购物车
     * @param classId
     * @param userId
     * @param counselorId
     * @return
     */
    OuterShoppingCartDto addToShoppingCart(Long classId, Long userId, Long counselorId);

    /**
     * 删除购物车课程
     * @param outerShoppingCartIds
     * @param userId
     */
    void deleteShoppingCart(List<Long> outerShoppingCartIds,Long userId);

    /**
     * 购物车数量
     * @param userId
     * @return
     */
    Long countNumOfShoppingCart(Long userId);

    /**
     * 购物车列表
     * @param userId
     * @return
     */
    Collection<ShoppingCartDetailDto> findShoppingCartList(Long userId);


    /**
     * 计算优惠
     * @param outerShoppingCartIds
     * @return
     */
    Collection<DiscountDetailDto> calDiscountFromShoppingCart(List<Long> outerShoppingCartIds,Long studentId);


    /**
     * 获取优惠信息
     * @param classIds
     * @return
     */
    Collection<DiscountDto> findAvailableDiscountForCourseClass(List<Long> classIds );


    /**
     * 直接创建订单
     * @param classId
     * @param studentId
     * @param userId
     * @param counselorId
     * @param channel 订单渠道 pc or mobile
     * @return 返回订单id
     */
    Long createOuterOrder(Long classId, Long studentId , Long userId , Long counselorId , String channel );

    /**
     * 从购物车创建订单
     * @param outerShoppingCartIds
     * @param userId
     * @param channel 订单渠道 pc or mobile
     * @return 返回订单id
     */
    Long createOuterOrderFromShoppingCart(List<Long> outerShoppingCartIds,Long studentId , Long userId , String channel );


    /**
     *
     * @param userId
     * @param pageNo
     * @param pageSize
     * @param chargingStatusList 缴费状态 0:未缴费 1:欠费 2:已缴费,4超时撤销
     * @return
     */
    PageDto<OuterOrderDetailDto> findOuterOrder(Long userId, int pageNo, int pageSize,List<Integer> chargingStatusList );


    /**
     * 取消订单
     * @param outerOrderId
     * @return
     */
    boolean cancelOrder(Long outerOrderId );


    /**
     * 订单信息
     * @param outerOrderId
     * @return
     */
    OuterOrderDetailDto findOuterOrder(Long outerOrderId );


    int findOuterOrderChargingStatus(Long outerOrderId);

    /**
     * 添加优惠码
     * @param outerOrderId
     * @param discountCode
     * @param discountId
     */
    void addDiscountCode(Long outerOrderId ,String discountCode,Long discountId);

    /**
     * 优惠码查询
     * @param outerOrderId
     * @param discountCode
     * @param discountId
     * @return
     */
    QueryDiscountCodeResultDto queryDiscountCode(Long outerOrderId ,String discountCode,Long discountId) ;


    Collection<OrderDiscountItemDto> findByCourseOrderIds(Long outerOrderId);

}
